<div class="hbox hbox-auto-xs hbox-auto-sm" ng-init="
    app.settings.asideFolded = false;
    app.settings.asideDock = false;
  ">
    <!-- main -->
    <div class="col">
        <!-- main header -->
        <div class="bg-light lter b-b wrapper-md">
            <div class="row">
                <div class="col-sm-6 col-xs-12">
                    <h1 class="m-n font-thin h3 text-black"><span class="font-bold"><img
                            src="img/simpleicons/kubernetes_name_blue.svg" width="160" height="25"></span></h1>
                    <small class="text-muted">集群详情</small>
                </div>
            </div>
        </div>
        <!-- / main header -->
        <div class="wrapper-md">
            <!-- toaster directive -->
            <toaster-container
                    toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
            <!-- / toaster directive -->

            <uib-tabset>
                <div class="panel panel-default" ng-controller="clusterCtrl">
                    <div class="panel-body">

                        <form class="form-inline" role="form">

                            <div class="form-group">
                                <button type="button" class="btn btn-info" ng-click="doQuery()"><span
                                        class="glyphicon glyphicon-search"></span>搜索
                                </button>

                                <button type="button" class="btn btn-success" ng-click="addCluster()"
                                        ng-if="contains(authPoint, '/kubernetes/save')">
                                    <i class="glyphicon glyphicon-plus" ng-show="!btnSyncDisabled"></i>新建
                                </button>
                            </div>
                        </form>

                        <div class="panel panel-default" style="margin-top: 5px;">
                            <div class="panel-body">
                                <div>
                                    <table class="table table-hover table-bordered table-striped">
                                        <thead>
                                        <tr>
                                            <td>集群名称</td>
                                            <td>命名空间配置</td>
                                            <td>服务器组</td>
                                            <td>创建时间</td>
                                            <td ng-if="contains(authPoint, '/kubernetes/save')">操作</td>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat="item in pageData">
                                            <td>
                                                <b style="color: #2b669a">{{item.name}}</b>
                                                <b class="pull-right" style="color: #777">{{item.description}}</b>
                                            </td>
                                            <td>
                                                <b style="color: #777">{{item.namespace}}</b>
                                            </td>
                                            <td>
                                                <b style="color: #2b669a">{{item.serverGroupName}}</b>
                                            </td>
                                            <td>{{(item.gmtModify == null || item.gmtModify == '') ? item.gmtCreate
                                                : item.gmtModify}}
                                            </td>
                                            <td ng-if="contains(authPoint, '/kubernetes/save')">
                                                <button ng-click="editCluster(item)"
                                                        class="btn btn-xs"
                                                        style="background-color: #2e6da4; color: white;">
                                                    <span class="glyphicon glyphicon-edit"></span>编辑
                                                </button>

                                                <button ng-click="syncClusterLabel(item)"
                                                        class="btn btn-xs"
                                                        style="background-color: #20a03f; color: white;">
                                                    <span class="fa fa-spin fa-spinner" ng-show="btnSyncClusterLabel"></span>
                                                    <span class="glyphicon glyphicon-play" ng-show="!btnSyncClusterLabel"></span>同步标签
                                                </button>

                                                <button ng-click="delCluster(item.id)"
                                                        class="btn btn-xs pull-right"
                                                        style="background-color: red; color: white;">
                                                    <span class="glyphicon glyphicon-remove"></span>删除
                                                </button>

                                            </td>
                                        </tr>
                                        </tbody>
                                        <tfoot>
                                        </tfoot>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </uib-tabset>
        </div>
    </div>
    <!-- / main -->
</div>

<script type="text/ng-template" id="clusterInfo">
    <div ng-include="'tpl/modal/kubernetes/cluster_info_modal.html'"></div>
</script>

